<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" >


    <script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>

    <title>分享页</title>

    <style type="text/css">
        body {margin: 0;}
        a {position: absolute;}
        #app img {display: block; width: 100%; height: 100%}
        #app{margin: 0 auto;position: relative;max-width: 750px;position: absolute;}
        .center{text-align: center;}
        .login-page {
            width: 360px;
            padding: 8% 0 0;
            margin: auto;
        }
        .form {
            position: relative;
            z-index: 1;
            background: #FFFFFF;
            max-width: 360px;
            margin: 200px 25px 100px;
            padding: 25px;
            text-align: center;
            box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
        }
        .form input {
            font-family: "Roboto", sans-serif;
            outline: 0;
            background: #f2f2f2;
            width: 85%;
            border: 0;
            margin: 0 0 20px;
            padding: 5px;
            box-sizing: border-box;
            font-size: 14px;
			border-radius:6px
        }
        .form button {
            font-family: "Microsoft YaHei","Roboto", sans-serif;
            text-transform: uppercase;
            outline: 0;
            background: #D8D8D8;
            width: 100%;
            border: 0;
            padding: 15px;
            color: #1a1a1a;
            font-size: 14px;
            -webkit-transition: all 0.3 ease;
            transition: all 0.3 ease;
            cursor: pointer;
			border-radius:6px
        }

        .form .message {
            margin: 15px 0 0;
            color: #b3b3b3;
            font-size: 12px;
        }
        .form .message a {
            color: #4CAF50;
            text-decoration: none;
        }
        .form .register-form {
            display: none;
        }
        .container {
            position: relative;
            z-index: 1;
            max-width: 300px;
            margin: 0 auto;
        }
        .container:before, .container:after {
            content: "";
            display: block;
            clear: both;
        }
        .container .info {
            margin: 50px auto;
            text-align: center;
        }
        .container .info h1 {
            margin: 0 0 15px;
            padding: 0;
            font-size: 36px;
            font-weight: 300;
            color: #1a1a1a;
        }
        .container .info span {
            color: #4d4d4d;
            font-size: 12px;
        }
        .container .info span a {
            color: #000000;
            text-decoration: none;
        }
        .container .info span .fa {
            color: #EF3B3A;
        }

        .shake_effect{
            -webkit-animation-name: shake;
            animation-name: shake;
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
        }
        @-webkit-keyframes shake {
            from, to {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }

            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: translate3d(-10px, 0, 0);
                transform: translate3d(-10px, 0, 0);
            }

            20%, 40%, 60%, 80% {
                -webkit-transform: translate3d(10px, 0, 0);
                transform: translate3d(10px, 0, 0);
            }
        }

        @keyframes shake {
            from, to {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }

            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: translate3d(-10px, 0, 0);
                transform: translate3d(-10px, 0, 0);
            }

            20%, 40%, 60%, 80% {
                -webkit-transform: translate3d(10px, 0, 0);
                transform: translate3d(10px, 0, 0);
            }
        }
        p.center{
            color: #fff;font-family: "Microsoft YaHei";
        }
        label {float: left; display: inline-block;vertical-align: middle;}
        input {
            vertical-align: middle;
        }
        p{font-size: 12px;color: #999999;}
    </style>
</head>


<body>

<div  id='app'   data-role="main" class="ui-content">

    <img src="https://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/Rectangle%20108%402x.png" width="750" height="1038" />

    <img src="https://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/Rectangle%402x.png" width="750" height="160" class="btn_click" />


    <img src="https://hem.oss-cn-beijing.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20190102160009.png" width="750"  />

</div>


<div class="htmleaf-container" style="display:none;">
    <div id="wrapper" class="login-page">
        <div id="login_form" class="form">
            <h4>验证手机号</h3>
                <p >为绑定邀请关系，只需要完成手机号验证即可体验荷尔蒙哦</p>
               
                    <label for="fname" ><img src="http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/Rectangle%205%402x.png" width="24" height="24" /></label>
                    <input type="text"  id="phone" placeholder="输入手机号"  />

                    <label for="yzm"><img src="http://heermeng.oss-cn-hangzhou.aliyuncs.com/landing/Rectangle%206%402x.png" width="24" height="24" /></label>
                    <input type="text" id="yzm" placeholder="验证码"  style="width:50%;"/>

                    <input type="button" id="bnt" value="获取验证码" onclick="sendmsg()" style="width:34%;background:#FFCA54"/>

                    <button id="login"  onclick="checkmsg()" >确 认</button>
               
        </div>
    </div>
</div>





</div>



<script type="text/javascript">

    //弹窗
    $(".btn_click").click(function(){
		if(!$(".btn_click").hasClass('disbtn')){
		 $(".htmleaf-container").show();
		}
    });
	
	 $("#app>img:eq(0)").click(function(){
		
		 $(".htmleaf-container").hide();
		
    });
	

    //发生验证码
    function sendmsg(){
        var phone = $("#phone").val();

        if(!isPoneAvailable(phone)){
            alert("手机格式错误");
        }else {

		$.getJSON("http://api.tzlc51.com:8080/forgetPwd/sendMsg_Get?callback=?", {phone: phone} , function(data) {
            if (data.ret==1) {	
					countDown();
					$("#login").css('background','#FFCA54');
				}
			});  
        }
    }

    //校验验证码
    function checkmsg(){
        var phone = $("#phone").val();
        var uid = getParameterByName('uid');
        var fxcode = getParameterByName('fxcode');
        var yzm = $("#yzm").val();
		
		if(!isPoneAvailable(phone)){
            alert("手机格式错误");
        }else{
		
			if(yzm==""){
				alert("验证码不能为空");
			}else{
			    $.getJSON("http://api.tzlc51.com:8080/forgetPwd/checkCodeAndAddUidAndFid?callback=?", {phone: phone,uid:uid,fxcode:fxcode,code:yzm}, function(data) {
		
					if (data.ret==1) {
						
						$(".btn_click").addClass("disbtn").attr("src","http://hem.oss-cn-beijing.aliyuncs.com/Rectangle%402x.png");
						$(".htmleaf-container").hide();						
						 // 跳转下载页面
						window.location = appurl();
					}else {
						
						alert("验证码不对");
						window.location.reload();
					}
				}); 
			 
			}
		}
    }
    //验证手机号码
    function isPoneAvailable(poneInput) {
        var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
        if (!myreg.test(poneInput)) {
            return false;
        } else {
            return true;
        }
    }

    // 获取url 参数变量
    function getParameterByName(paramName) {
        var args = new Object();
        var argsStr = location.search;  //获取URL参数字符串
        if (argsStr.length > 0) {
            argsStr = argsStr.substring(1);
            var nameValueArr = argsStr.split("&");  //多参数
            for (var i = 0; i < nameValueArr.length; i++) {
                var pos = nameValueArr[i].indexOf('=');
                if (pos == -1) continue; //如果没有找到就跳过
                var argName = nameValueArr[i].substring(0, pos); //提取name
                var argVal = nameValueArr[i].substring(pos + 1); //提取value
                args[argName] = unescape(argVal);
            }
            return args[paramName];
        }
    }

    // 倒计时
    var flag = 1;
    var i = 60;
    function countDown() {
        i = i - 1;
        $('#bnt').val(i+"秒后重发");

        $('#bnt').css("background-color","#DDDDDD");
        if (i == 0) {
            $('#bnt').css("background-color","#FFCA54");
            $('#bnt').val("重新发送");
            flag = 1;
            i = 60;
            return;
        }
        setTimeout('countDown()',1000);
    }

    //判断下载链接
    function appurl(){
        if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
            //alert(navigator.userAgent);
            return '<{$ios_url}>' ;
        } else if (/(Android)/i.test(navigator.userAgent)) {
            //alert(navigator.userAgent);
            return '<{$android_url}>';

        } else {
            return 'http://www.baidu.com/';

        };

    }

</script>





</body>
</html>
